home *** CD-ROM | disk | FTP | other *** search
- Case $400 ; a key has been pressed!
-
- i$=Inkey$ ; MOST IMPORTANT!!! Enables input to be read
-
- Select RawKey ; find out which key it was
- q=Qualifier
-
- FlushEvents ; stop the storing of keypresses after the first keypress has been read
-
- Case $45 ; ESC key pressed
- menuquit{}
-
- Case $4E ; right arrow
- If mappos.pos\x+(columns+1)<mapsize.size\x ; if not at righthand edge of map
-
- If q=1 OR q=2 ; left or right shift
- UnBuffer 0 ; remove cursor and replace background
- mappos\x=mappos\x+(columns+1) ; move whole screen to right
- If mappos\x+(columns+1)>mapsize\x ; if gone over size of map
- mappos\x=mapsize\x-(columns+1) ; set mappos\x within limits
- EndIf
- drawmap{rows,columns,shift}
- Else
-
- If q=16 OR q=32 ; left or right Alt
- UnBuffer 0 ; remove cursor and replace background
- mappos\x=mappos\x+Int((columns+1)/4) ; move right
- If mappos\x+Int((columns+1)/4)>mapsize\x
- mappos\x=mapsize\x-Int((columns+1)/4)
- EndIf
- drawmap{rows,columns,shift}
- Else
- mapright{rows,columns,shift,y_blit}
- EndIf
-
- EndIf
-
- EndIf
-
- Case $4F ; left arrow
- If mappos\x>0 ; if not at lefthand edge of map
-
- If q=1 OR q=2 ; left or right shift
- UnBuffer 0 ; remove cursor and replace background
- mappos\x=mappos\x-(columns+1) ; move whole screen left
- If mappos\x<0 ; If gone beyond map
- mappos\x=0 ; keep within limits
- EndIf
- drawmap{rows,columns,shift}
- Else
-
- If q=16 OR q=32 ; left or right Alt
- UnBuffer 0 ; remove cursor and replace background
- mappos\x=mappos\x-Int((columns+1)/4) ; move right
- If mappos\x<0
- mappos\x=0
- EndIf
- drawmap{rows,columns,shift}
- Else
- mapleft{rows,columns,shift,y_blit}
- EndIf
-
- EndIf
-
- EndIf
-
- Case $4C ; up arrow
- If mappos\y>0 ; if not at top of map
- If q=1 OR q=2 ; left or right shift
- UnBuffer 0 ; remove cursor and replace background
- mappos\y=mappos\y-(rows+1) ; move whole screen up
- If mappos\y<0 ; beyond map
- mappos\y=0 ; keep within limits
- EndIf
- drawmap{rows,columns,shift}
- Else
-
- If q=16 OR q=32 ; left or right Alt
- UnBuffer 0 ; remove cursor and replace background
- mappos\y=mappos\y-Int((rows+1)/4) ; move right
- If mappos\y<0
- mappos\y=0
- EndIf
- drawmap{rows,columns,shift}
- Else
- mapup{rows,columns,shift,y_blit}
- EndIf
-
- EndIf
-
- EndIf
-
- Case $4D ; down arrow
- If mappos\y+(rows+1)<mapsize\y ; if not at bottom of map
-
- If q=1 OR q=2 ; left or right shift
- UnBuffer 0 ; remove cursor and replace background
- mappos\y=mappos\y+(rows+1) ; move down whole screen
- If mappos\y+(rows+1)>mapsize\y ; beyond limits
- mappos\y=mapsize\y-(rows+1) ; keep within limits
- EndIf
- drawmap{rows,columns,shift}
- Else
-
- If q=16 OR q=32 ; left or right Alt
- UnBuffer 0 ; remove cursor and replace background
- mappos\y=mappos\y+Int((rows+1)/4) ; move right
- If mappos\y+((rows+1)/4)>mapsize\y
- mappos\y=mapsize\y-((rows+1)/4)
- EndIf
- drawmap{rows,columns,shift}
- Else
- mapdown{rows,columns,shift,y_blit}
- EndIf
-
- EndIf
-
- EndIf
-
-